<div class="popup clearfix" style="width:600px;">
	<div class="header">
		<i class="icon_w icon_circle"></i>
			圈内成员
		<i class="icon_w icon_close" style="float:right; cursor:pointer;" onclick="UM_LAYER.close();"></i>
	</div>
	<div id="member_list" class="content clearfix">
	</div>
</div>
<script type="text/javascript">
var circle_member = new function () {
	var target_ob 	= $('#member_list');
	var circle_id 	= '<{$circle_id}>';
	var page		= 1;
	
	function get_member_id_str () {
		var member_id_str = '';
		$('#member_list :checkbox:checked').each(function(){
			member_id_str += $(this).val() + ',';
		});
		return member_id_str;
	}
	this.reload = function (p) {
		if (typeof(p) == 'number') page = p;
		loadMod('circle/show_member_list', {'id':circle_id, 'page':page}, target_ob);
	}
	this.remove = function () {
		var members = get_member_id_str();
		if (members) {
			if (confirm('你确定要删除这些成员吗？')) {
				loadMod('circle/action_member_manager', {'type':'remove', 'circle_id':circle_id, 'members':members}, '', function (msg) {
					if (msg == 'true') {
						circle_member.reload();
					} else {
						alert('操作失败，请联系网站管理员！');
					}
				} );
			}
		}
	}
	this.to_admin = function () {
		var members = get_member_id_str();
		if (members) {
			if (confirm('你确定要设定这些成员为管理员吗？')) {
				loadMod('circle/action_member_manager', {'type':'to_admin', 'circle_id':circle_id, 'members':members}, '', function (msg) {
					if (msg == 'true') {
						circle_member.reload();
					} else {
						alert('操作失败，请联系网站管理员！');
					}
				} );
			}
		}
	}
	this.to_normal = function () {
		var members = get_member_id_str();
		if (members) {
			if (confirm('你确定要取消他们的管理员权限吗？')) {
				loadMod('circle/action_member_manager', {'type':'to_normal', 'circle_id':circle_id, 'members':members}, '', function (msg) {
					if (msg == 'true') {
						circle_member.reload();
					} else {
						alert('操作失败，请联系网站管理员！');
					}
				} );
			}
		}
	}
}
circle_member.reload(1);
</script>